{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "03a4402d",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Import libraries\n",
    "import numpy as np\n",
    "import yfinance as yf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "61924276",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Use the `yfinance` library to download the front month S&P500 futures price data.\n",
    "sp500_prices = yf.download('ES=F')['Adj Close']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a2f1ca43",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Calculate the daily logarithmic returns of the futures prices.\n",
    "# YOUR CODE HERE\n",
    "log_returns = None"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5fc5077e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Calculate the standard deviation (volatility) of the logarithmic returns\n",
    "# YOUR CODE HERE\n",
    "daily_volatility = None"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c7ee4206",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Annualize the volatility\n",
    "# There are approximately 252 trading days in a year\n",
    "# YOUR CODE HERE\n",
    "annualized_volatility = None\n",
    "print()\n",
    "print(f\"annualized_volatility: {np.round(annualized_volatility * 100, 2)}%\")\n",
    "print()"
   ]
  }
 ],
 "metadata": {
  "jupytext": {
   "cell_metadata_filter": "-all",
   "main_language": "python",
   "notebook_metadata_filter": "-all"
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
